/* 
 * File:   Scanner.h
 * Author: ScaV
 *
 * Created on October 18, 2011, 6:23 PM
 */

#ifndef SCANNER_H
#define	SCANNER_H

#include "lexeme.h"
#include <fstream>

class scanner {
public:
	scanner(const char *str);
	virtual ~scanner();
	
	lexeme *getNextLex();
	bool eof() { return infile.eof(); };
	
private:
	std::vector<char> str;
	std::ifstream infile;
	static const int N = 34;
	bool *states;
	int line;
	
	bool *getNextStates(char ch);
	LEX_TYPE checkFinal();
	bool isAlive();
	void reset();
};

#endif	/* SCANNER_H */

